use vudu

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		juan
-- este procedimento busca todas las materia de un
-- pensum en especial
-- =============================================
CREATE PROCEDURE sp_materias_pensum 
	@id_pensum  int
	
	 
AS
BEGIN


	SELECT DISTINCT m.nombreMateria, p.semestre, m.unidadesDeCredito,m.horasTeoria ,m.horasPractica, m.id_Materia
	FROM PensumMateria p,Materia m
	WHERE (fk_id_pensum=@id_pensum) and (fk_id_materia=id_Materia)
	ORDER BY p.semestre

END
GO
